<template>
  <div class="collect">
    <!-- 头部 -->
    <div class="header-nav">
      <div class="header-nav-update"></div>
      <!-- 选项卡 -->
      <div class="header-nav-tab">
        <div
          :class="0 == selectIndex ? 'header-tab-active tab-item' : 'tab-item'"
          @click="ContentTab(0)"
        >
          全部
        </div>
        <div
          :class="1 == selectIndex ? 'header-tab-active tab-item' : 'tab-item'"
          @click="ContentTab(1)"
        >
          收藏
        </div>
        <div
          :class="2 == selectIndex ? 'header-tab-active tab-item' : 'tab-item'"
          @click="ContentTab(2)"
        >
          咨询
        </div>
      </div>
      <!-- 编辑 -->
      <div class="header-nav-update">编辑</div>
    </div>
    <!-- 内容 -->
    <div class="main-content">
      <!-- 子盒子 -->
      <div
        class="content-item"
        :style="{ display: 0 == selectIndex ? 'block' : 'none' }"
      >
        <!-- <div class="AllContent">
          <div class="AllContent-img">
            <img src="./../../assets/images/collection/collect_img1.jpg" alt="" />
          </div>
          <div class="AllContent-tite">你还没有咨询过车辆，收藏也是空的奥</div>
          <div class="AllContent-tite2">快去收藏心仪的车辆吧</div>
          <div class="AllContent-button">开始选车</div>
        </div> -->
        <div class="AllContentList">
          <div class="AllContentList-item">
            <div class="item-information">
              <div class="information-img">
                <img src="./../../assets/images/collection/coolect_img2.jpg" alt="" />
              </div>
              <div class="information-title">
                <img src="./../../assets/images/collection/collect_img4.jpg" alt="" />
                阿虎号丢失发挥地方你偶尔违法未批复大道无情多无群东湖文化对我的hi我的
              </div>
              <div class="information-prml">
                <div class="information-price">15.78万</div>
                <div class="information-mileage">2020年/0.6公里</div>
              </div>
            </div>
            <div class="item-cardata">
              <div class="cardata-img">
                <img src="./../../assets/images/collection/collect_img3.jpg" alt="" />
              </div>
              <div class="cardata-operation">
                <div class="operation-consult">在线咨询</div>
                <div class="operation-comparison">对比</div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div
        class="content-item"
        :style="{ display: 1 == selectIndex ? 'block' : 'none' }"
      >
        <div class="AllContent">
          <div class="AllContent-img">
            <img src="./../../assets/images/collection/collect_img1.jpg" alt="" />
          </div>
          <div class="AllContent-tite">你还没有车辆加入收藏</div>
          <div class="AllContent-tite2">快去挑选心仪的车辆吧</div>
          <div class="AllContent-button">开始选车</div>
        </div>
      </div>
      <div
        class="content-item"
        :style="{ display: 2 == selectIndex ? 'block' : 'none' }"
      >
        <div class="AllContent">
          <div class="AllContent-img">
            <img src="./../../assets/images/collection/collect_img1.jpg" alt="" />
          </div>
          <div class="AllContent-tite">你还没有咨询过车辆呢</div>
          <div class="AllContent-tite2">快去收藏心仪的车辆吧</div>
          <div class="AllContent-button">开始选车</div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      selectIndex: 0,
    };
  },
  methods: {
    ContentTab(index) {
      this.selectIndex = index;
    },
  },
};
</script>
<style lang="less">
img {
  vertical-align: middle;
}
/* 外层盒子 */
.collect {
  width: 100vw;
  height: 100vh;
  background: #f6f6f6;
  /* 头部导航栏 */
  .header-nav {
    height: 98px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 0 10px;
    /* 头部选项卡 */
    .header-nav-tab {
      display: flex;
      /* 子选项 */
      .tab-item {
        margin: 0 16px;
        font-size: 32px;
        box-sizing: border-box;
        height: 98px;
        line-height: 98px;
      }
    }
    /* 编辑按钮 */
    .header-nav-update {
      width: 98px;
      font-size: 32px;
    }
    /* 选中状态 */
    .header-tab-active {
      border-bottom: 6px solid red;
    }
  }
  /* 内容部分 */
  .main-content {
    height: 100vh;
    // background: red;
    /* 内容部分子盒子布局 */
    .content-item {
      //   background: yellow;
      height: 100vh;
      display: none;
      /* 无数据时的提示布局*/
      .AllContent {
        text-align: center;
        width: 100vw;

        padding-top: 30%;
        box-sizing: border-box;
        /* img */
        .AllContent-img {
          margin: 0 auto;
          width: 242px;
          height: 170px;
          img {
            width: 242px;
            height: 170px;
          }
        }
        /* title */
        .AllContent-tite {
          margin-top: 86px;
          font-size: 30px;
          font-weight: 700;
        }
        .AllContent-tite2 {
          margin-top: 28px;
          font-size: 26px;
        }
        .AllContent-button {
          width: 252px;
          height: 76px;
          line-height: 76px;
          text-align: center;
          margin: 0 auto;
          border: 2px solid #df6621;
          margin-top: 48px;
          border-radius: 50px;
          font-size: 40px;
          color: #df6621;
        }
      }
      /* 列表布局 */
      .AllContentList {
        .AllContentList-item {
          height: 460px;
          margin: 20px 30px 0;
          background: white;
          box-sizing: border-box;
          padding: 38px 20px;
          display: flex;
          /* 左侧 */
          .item-information {
            width: 326px;
            display: flex;
            flex-direction: column;
            justify-content: space-around;
            text-align: left;

            .information-img {
              width: 326px;
              height: 222px;
              img {
                width: 326px;
                height: 222px;
              }
            }
            /* 标题 */
            .information-title {
              width: 100%;
              text-overflow: ellipsis;
              overflow: hidden;
              display: -webkit-box;
              -webkit-line-clamp: 2;
              -webkit-box-orient: vertical;
              font-weight: 700;
              font-size: 28px;
              img {
                width: 98px;
                height: 32px;
              }
            }
            /* 价格和公里数 */
            .information-prml {
              display: flex;
              justify-content: space-between;
              box-sizing: border-box;
              padding: 0 10px;
              /* 价格 */
              .information-price {
                font-size: 30px;
                font-weight: 700;
                color: #f05700;
              }
              .information-mileage {
                color: #8e8e8e;
                font-size: 22px;
              }
            }
          }
          /* 右侧 */
          .item-cardata {
            width: 348px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            img {
              width: 348px;
              height: 308px;
            }
            /* 操作 */
            .cardata-operation {
              display: flex;
              justify-content: space-around;
              .operation-consult,
              .operation-comparison {
                width: 136px;
                height: 70px;
                border-radius: 5px;
                border: 2px solid #df6621;
                text-align: center;
                line-height: 70px;
                color: #df6621;
                font-size: 24px;
              }
            }
          }
        }
      }
    }
  }
}
</style>
